Magnetic sensor including two bias magnetic field generation units for generating stable bias magnetic field

ABSTRACT

A magnetic sensor includes an MR element and two bias magnetic field generation units. The two bias magnetic field generation units are spaced apart from each other along a first direction and configured to cooperate with each other to generate a bias magnetic field. Each bias magnetic field generation unit includes a ferromagnetic layer and an antiferromagnetic layer stacked along a second direction orthogonal to the first direction. An element placement region is formed between the two bias magnetic field generation units when viewed in the second direction in an imaginary plane perpendicular to the second direction and intersecting the MR element. The element placement region includes a middle region and two end regions. The MR element is placed to lie within the middle region in the imaginary plane.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a magnetic sensor including a magneticdetection element and two bias magnetic field generation units, the twobias magnetic field generation units being configured to cooperate witheach other to generate a bias magnetic field to be applied to themagnetic detection element.

2. Description of the Related Art

In recent years, magnetic sensor systems have been employed to detect aphysical quantity associated with the rotational movement or linearmovement of a moving object in a variety of applications. Typically, amagnetic sensor system includes a scale and a magnetic sensor, and themagnetic sensor is configured to generate a signal associated with therelative positional relationship between the scale and the magneticsensor.

The magnetic sensor includes a magnetic detection element for detectinga magnetic field to be detected. Hereinafter, the magnetic field to bedetected will be referred to as the target magnetic field. U.S. PatentApplication Publication No. 2014/0292322 A1 discloses a magnetic sensorthat uses a so-called spin-valve magnetoresistance (MR) element as themagnetic detection element. The spin-valve MR element includes amagnetization pinned layer having a magnetization pinned in a certaindirection, a free layer having a magnetization that varies depending onthe target magnetic field, and a nonmagnetic layer located between themagnetization pinned layer and the free layer. Examples of thespin-valve MR element include a TMR element in which the nonmagneticlayer is a tunnel barrier layer, and a GMR element in which thenonmagnetic layer is a nonmagnetic conductive layer.

Some magnetic sensors have means for applying a bias magnetic field tothe magnetic detection element. The bias magnetic field is used to allowthe magnetic detection element to respond linearly to a variation in thestrength of the target magnetic field. In a magnetic sensor that uses aspin-valve MR element, the bias magnetic field is used also to make thefree layer have a single magnetic domain and to orient the magnetizationof the free layer in a certain direction, when there is no targetmagnetic field.

U.S. Patent Application Publication No. 2014/0292322 A1 discloses amagnetic sensor including a spin-valve MR element, and a pair ofpermanent magnets for generating a bias magnetic field. The pair ofpermanent magnets are opposed to each other with the MR elementtherebetween.

Magnetic sensors that use a pair of permanent magnets as the means forgenerating a bias magnetic field, such as those disclosed in U.S. PatentApplication Publication No. 2014/0292322 A1, have the followingproblems. Such magnetic sensors are typically used under the conditionthat the strength of the target magnetic field does not exceed thecoercivity of the permanent magnets. However, since the magnetic sensorscan be used in various environments, an external magnetic field having astrength exceeding the coercivity of the permanent magnets can happen tobe temporarily applied to the permanent magnets. When such an externalmagnetic field is temporarily applied to the permanent magnets, themagnetization direction of the permanent magnets may be changed from anoriginal direction and then remain different from the original directioneven after the external magnetic field disappears. In such a case, thedirection of the bias magnetic field differs from a desired direction.

OBJECT AND SUMMARY OF THE INVENTION

It is an object of the present invention to provide a magnetic sensorthat allows application of a stable bias magnetic field to a magneticdetection element.

A magnetic sensor of the present invention includes: at least onemagnetic detection element for detecting a target magnetic field; and afirst bias magnetic field generation unit and a second bias magneticfield generation unit configured to cooperate with each other togenerate a bias magnetic field to be applied to the at least onemagnetic detection element. The first bias magnetic field generationunit and the second bias magnetic field generation unit are spaced apredetermined distance apart from each other along a first direction.Each of the first and second bias magnetic field generation unitsincludes a ferromagnetic layer and a first antiferromagnetic layerstacked along a second direction orthogonal to the first direction. Theferromagnetic layer has a first surface and a second surface located atopposite ends in the second direction. The first antiferromagnetic layeris in contact with the first surface of the ferromagnetic layer andexchange-coupled to the ferromagnetic layer.

Each of the first and second bias magnetic field generation units has afirst end and a second end opposite to each other in a third directionorthogonal to both of the first direction and the second direction.Here, a first imaginary straight line and a second imaginary straightline are defined in an imaginary plane perpendicular to the seconddirection and intersecting the at least one magnetic detection element.The first imaginary straight line passes through the first end of eachof the first and second bias magnetic field generation units when viewedin the second direction. The second imaginary straight line passesthrough the second end of each of the first and second bias magneticfield generation units when viewed in the second direction. In themagnetic sensor of the present invention, the first and second biasmagnetic field generation units are positioned to define an elementplacement region in the imaginary plane. The element placement region islocated between the first bias magnetic field generation unit and thesecond bias magnetic field generation unit when viewed in the seconddirection, and between the first imaginary straight line and the secondimaginary straight line.

The element placement region includes a first end region, a second endregion and a middle region each of which has an area. The first endregion is located closer to the first imaginary straight line than isthe middle region. The second end region is located closer to the secondimaginary straight line than is the middle region. The middle region islocated between the first end region and the second end region, borderson the first end region along a first border line parallel to the firstimaginary straight line, and borders on the second end region along asecond border line parallel to the second imaginary straight line. Theat least one magnetic detection element is placed such that the entiretyof the at least one magnetic detection element lies within the middleregion in the imaginary plane.

In the magnetic sensor of the present invention, the ferromagnetic layermay have a magnetization in a direction parallel to the first direction.The bias magnetic field at a location where the at least one magneticdetection element is placed may contain a component in the samedirection as the magnetization of the ferromagnetic layer.

In the magnetic sensor of the present invention, the distance betweenthe first imaginary straight line and the first border line, and thedistance between the second imaginary straight line and the secondborder line may both be 30% of the distance between the first biasmagnetic field generation unit and the second bias magnetic fieldgeneration unit.

In the magnetic sensor of the present invention, the imaginary plane mayintersect the first and second bias magnetic field generation units.

In the magnetic sensor of the present invention, the at least onemagnetic detection element may be at least one magnetoresistanceelement. The at least one magnetoresistance element may include amagnetization pinned layer having a magnetization pinned in a certaindirection, a free layer having a magnetization that varies depending onthe target magnetic field, and a nonmagnetic layer located between themagnetization pinned layer and the free layer. The magnetization pinnedlayer, the nonmagnetic layer and the free layer may be stacked along thesecond direction. The imaginary plane may intersect the ferromagneticlayer of each of the first and second bias magnetic field generationunits and the free layer of the at least one magnetoresistance element.

In the magnetic sensor of the present invention, each of the first andsecond bias magnetic field generation units may further include a secondantiferromagnetic layer that is in contact with the second surface ofthe ferromagnetic layer and exchange-coupled to the ferromagnetic layer.

In each of the first and second bias magnetic field generation units ofthe magnetic sensor of the present invention, the direction of themagnetization of the ferromagnetic layer is determined by the exchangecoupling between the first antiferromagnetic layer and the ferromagneticlayer. In each of the first and second bias magnetic field generationunits, even if an external magnetic field having a high strengthsufficient to reverse the direction of the magnetization of theferromagnetic layer is temporarily applied, the direction of themagnetization of the ferromagnetic layer returns to an originaldirection upon disappearance of such an external magnetic field. Thus,the magnetic sensor of the present invention allows application of astable bias magnetic field to the magnetic detection element.

Other and further objects, features and advantages of the presentinvention will appear more fully from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a perspective view illustrating the general configuration of amagnetic sensor system of a first embodiment of the invention.

FIG. 2 is a perspective view of a magnetic sensor according to the firstembodiment of the invention.

FIG. 3 is a circuit diagram of the magnetic sensor according to thefirst embodiment of the invention.

FIG. 4 is an enlarged perspective view of a portion of the magneticsensor shown in FIG. 2.

FIG. 5 is an enlarged cross-sectional view of the portion of themagnetic sensor shown in FIG. 2.

FIG. 6 is an explanatory diagram illustrating the positionalrelationship between the MR element and the first and second biasmagnetic field generation units shown in FIG. 4 and FIG. 5.

FIG. 7 is a characteristic diagram illustrating the magnetization curveof a permanent magnet.

FIG. 8 is a characteristic diagram illustrating the magnetization curveof each of the first and second bias magnetic field generation unitsshown in FIG. 4 to FIG. 6.

FIG. 9 is a characteristic diagram illustrating the distribution ofstrength of a reference component of a bias magnetic field in areference plane for a first magnetic sensor model.

FIG. 10 is a characteristic diagram illustrating the distribution ofstrength of the reference component of the bias magnetic field in thereference plane for a second magnetic sensor model.

FIG. 11 is a characteristic diagram illustrating the distribution ofstrength of the reference component of the bias magnetic field in thereference plane for a third magnetic sensor model.

FIG. 12 is an explanatory diagram illustrating the positionalrelationship of MR elements with first and second bias magnetic fieldgeneration units in a second embodiment of the invention.

FIG. 13 is a perspective view illustrating the general configuration ofa magnetic sensor system of a third embodiment of the invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS First Embodiment

Preferred embodiments of the present invention will now be described indetail with reference to the drawings. First, reference is made to FIG.1 to describe an example of a magnetic sensor system including amagnetic sensor according to a first embodiment of the invention. FIG. 1is a perspective view illustrating the general configuration of themagnetic sensor system of the first embodiment. The magnetic sensorsystem shown in FIG. 1 includes the magnetic sensor 1 according to thefirst embodiment, and a rotation scale 50 for generating a targetmagnetic field, i.e., a magnetic field to be detected by the magneticsensor 1. In response to a rotational movement of a moving object (notillustrated), the rotation scale 50 rotates about a predeterminedcentral axis C in a rotational direction D. The relative positionalrelationship between the rotation scale 50 and the magnetic sensor 1 isthereby changed in the rotational direction D. The magnetic sensorsystem detects a physical quantity associated with the relativepositional relationship between the rotation scale 50 and the magneticsensor 1. More specifically, the magnetic sensor system detects, as theaforementioned physical quantity, the rotational position and/or therotational speed of the aforementioned moving body moving with therotation scale 50.

As shown in FIG. 1, the rotation scale 50 is a multipole-magnetizedmagnet having a plurality of pairs of N and S poles alternately arrangedin a circumferential direction. In the example shown in FIG. 1, therotation scale 50 has six pairs of N and S poles. The magnetic sensor 1is placed to face the outer circumferential surface of the rotationscale 50.

The direction of the target magnetic field varies periodically withvarying relative positional relationship between the rotation scale 50and the magnetic sensor 1. In the first embodiment, the direction of thetarget magnetic field changes as the rotation scale 50 rotates. In theexample shown in FIG. 1, one rotation of the rotation scale 50 causesthe direction of the target magnetic field to rotate six times, that is,to change by six periods.

The magnetic sensor 1 will now be described with reference to FIG. 2 andFIG. 3. FIG. 2 is a perspective view of the magnetic sensor 1. FIG. 3 isa circuit diagram of the magnetic sensor 1. The magnetic sensor 1includes at least one magnetic detection element for detecting thetarget magnetic field, and a first bias magnetic field generation unitand a second bias magnetic field generation unit configured to cooperatewith each other to generate a bias magnetic field to be applied to theat least one magnetic detection element. In the first embodiment, the atleast one magnetic detection element is at least one magnetoresistance(MR) element.

In the first embodiment, the magnetic sensor 1 includes four MR elements10A, 10B, 10C and 10D, in particular, as the at least one MR element.The magnetic sensor 1 further includes, as the first and second biasmagnetic field generation units, four pairs of first and second biasmagnetic field generation units (21A, 22A), (21B, 22B), (21C, 22C) and(21D, 22D) corresponding to the MR elements 10A, 10B, 10C and 10D,respectively. The four pairs of first and second bias magnetic fieldgeneration units (21A, 22A), (21B, 22B), (21C, 22C) and (21D, 22D)generate respective bias magnetic fields to be applied to thecorresponding MR elements 10A, 10B, 10C and 10D.

The first bias magnetic field generation unit 21A and the second biasmagnetic field generation unit 22A are spaced a predetermined distanceapart from each other along a first direction with the MR element 10Ainterposed therebetween. Now, X, Y and Z directions are defined as shownin FIG. 2. The X, Y and Z directions are orthogonal to one another. Inthe first embodiment, the first direction is the Y direction.

As used herein, each of the X, Y and Z directions is defined asincluding one particular direction and the opposite direction thereto,as indicated by the respective double-headed arrows in FIG. 2. On theother hand, the direction of any magnetic field or magnetization isdefined as indicating a single particular direction.

Like the positional relationship between the MR element 10A and thefirst and second bias magnetic field generation units 21A and 22Adescribed above, the first bias magnetic field generation unit 21B andthe second bias magnetic field generation unit 22B are spaced apredetermined distance apart from each other along the first direction(Y direction) with the MR element 10B interposed therebetween. The firstbias magnetic field generation unit 21C and the second bias magneticfield generation unit 22C are spaced a predetermined distance apart fromeach other along the first direction (Y direction) with the MR element10C interposed therebetween. The first bias magnetic field generationunit 21D and the second bias magnetic field generation unit 22D arespaced a predetermined distance apart from each other along the firstdirection (Y direction) with the MR element 10D interposed therebetween.

The magnetic sensor 1 further includes a substrate (not illustrated),two upper electrodes 31 and 32, and two lower electrodes 41 and 42. Thelower electrodes 41 and 42 are placed on the non-illustrated substrate.The upper electrode 31 has a base part 310, and two branch parts 311 and312 branching off from the base part 310. The upper electrode 32 has abase part 320, and two branch parts 321 and 322 branching off from thebase part 320. The lower electrode 41 has a base part 410, and twobranch parts 411 and 412 branching off from the base part 410. The lowerelectrode 42 has a base part 420, and two branch parts 421 and 422branching off from the base parts 420. The branch part 311 of the upperelectrode 31 is opposed to the branch part 411 of the lower electrode41. The branch part 312 of the upper electrode 31 is opposed to thebranch part 421 of the lower electrode 42. The branch part 321 of theupper electrode 32 is opposed to the branch part 412 of the lowerelectrode 41. The branch part 322 of the upper electrode 32 is opposedto the branch part 422 of the lower electrode 42.

The MR element 10A and the bias magnetic field generation units 21A and22A are located between the branch part 411 of the lower electrode 41and the branch part 311 of the upper electrode 31. The upper electrode31 and the lower electrode 41 are located on opposite sides of the MRelement 10A in the Z direction, and supply current to the MR element10A.

The MR element 10B and the bias magnetic field generation units 21B and22B are located between the branch part 421 of the lower electrode 42and the branch part 312 of the upper electrode 31. The upper electrode31 and the lower electrode 42 are located on opposite sides of the MRelement 10B in the Z direction, and supply current to the MR element10B.

The MR element 10C and the bias magnetic field generation units 21C and22C are located between the branch part 422 of the lower electrode 42and the branch part 322 of the upper electrode 32. The upper electrode32 and the lower electrode 42 are located on opposite sides of the MRelement 10C in the Z direction, and supply current to the MR element10C.

The MR element 10D and the bias magnetic field generation units 21D and22D are located between the branch part 412 of the lower electrode 41and the branch part 321 of the upper electrode 32. The upper electrode32 and the lower electrode 41 are located on opposite sides of the MRelement 10D in the Z direction, and supply current to the MR element10D.

As shown in FIG. 2, the base part 310 of the upper electrode 31 includesa first output port E1. The base part 320 of the upper electrode 32includes a second output port E2. The base part 410 of the lowerelectrode 41 includes a power supply port V. The base part 420 of thelower electrode 42 includes a ground port G.

The MR element 10A and the MR element 10B are connected in series viathe upper electrode 31. The MR element 10C and the MR element 10D areconnected in series via the upper electrode 32.

As shown in FIG. 3, one end of the MR element 10A is connected to thepower supply port V. The other end of the MR element 10A is connected tothe first output port E1. One end of the MR element 10B is connected tothe first output port E1. The other end of the MR element 10B isconnected to the ground port G. The MR elements 10A and 10B constitute ahalf-bridge circuit. One end of the MR element 10C is connected to thesecond output port E2. The other end of the MR element 10C is connectedto the ground port G. One end of the MR element 10D is connected to thepower supply port V. The other end of the MR element 10D is connected tothe second output port E2. The MR elements 10C and 10D constitute ahalf-bridge circuit. The MR elements 10A, 10B, 10C and 10D constitute aWheatstone bridge circuit.

A power supply voltage of a predetermined magnitude is applied to thepower supply port V1. The ground port G is grounded. Each of the MRelements 10A, 10B, 10C and 10D varies in resistance depending on thetarget magnetic field. The resistances of the MR elements 10A and 10Cvary in phase with each other. The resistances of the MR elements 10Band 10D vary 180° out of phase with the resistances of the MR elements10A and 10C. The first output port E1 outputs a first detection signalcorresponding to the potential at the connection point between the MRelements 10A and 10B. The second output port E2 outputs a seconddetection signal corresponding to the potential at the connection pointbetween the MR elements 10D and 10C. The first and second detectionsignals vary depending on the target magnetic field. The seconddetection signal is 180° out of phase with the first detection signal.The magnetic sensor 1 generates an output signal by computationincluding determining the difference between the first detection signaland the second detection signal. For example, the output signal of themagnetic sensor 1 is generated by adding a predetermined offset voltageto a signal obtained by subtracting the second detection signal from thefirst detection signal. The output signal of the magnetic sensor 1varies depending on the target magnetic field.

The first and second bias magnetic field generation units will now bedescribed in detail with reference to FIG. 4 and FIG. 5. FIG. 4 is anenlarged perspective view of a portion of the magnetic sensor 1 shown inFIG. 2. FIG. 5 is an enlarged cross-sectional view of the portion of themagnetic sensor 1 shown in FIG. 2. In the following description,reference numeral 10 will be used to represent any of the MR elements.Reference numerals 21 and 22 will be used to represent any of the firstbias magnetic field generation units and any of the second bias magneticfield generation units, respectively. Reference numerals 30 and 40 willbe used to represent whichever one of the upper electrodes and whicheverone of the lower electrodes, respectively. FIG. 4 and FIG. 5 illustratean MR element 10, first and second bias magnetic field generation units21 and 22 for generating a bias magnetic field to be applied to the MRelement 10, and an upper electrode 30 and a lower electrode 40 forsupplying current to the MR element 10.

As shown in FIG. 5, each of the first and second bias magnetic fieldgeneration units 21 and 22 includes a ferromagnetic layer 24 and a firstantiferromagnetic layer 23 stacked along a second direction orthogonalto the first direction (Y direction). In the first embodiment, thesecond direction is the Z direction. The ferromagnetic layer 24 has afirst surface 24 a and a second surface 24 b located at opposite ends inthe second direction (Z direction). The first antiferromagnetic layer 23is in contact with the first surface 24 a of the ferromagnetic layer 24and exchange-coupled to the ferromagnetic layer 24. In the example shownin FIG. 5, each of the first and second bias magnetic field generationunits 21 and 22 further includes a second antiferromagnetic layer 25 incontact with the second surface 24 b of the ferromagnetic layer 24 andexchange-coupled to the ferromagnetic layer 24. In this example, thefirst antiferromagnetic layer 23, the ferromagnetic layer 24 and thesecond antiferromagnetic layer 25 are stacked in this order along thesecond direction (Z direction).

In the first embodiment, the magnetic sensor 1 includes an insulatinglayer 20 interposed between the lower electrode 40 and the first andsecond bias magnetic field generation units 21 and 22. FIG. 2 and FIG. 4omit the illustration of the insulating layer 20, and schematicallyillustrate the arrangement of the first and second bias magnetic fieldgeneration units 21 and 22. The insulating layer 20 lies on the topsurface of the lower electrode 40. The first antiferromagnetic layer 23lies on the top surface of the insulating layer 20. The top surface ofthe second antiferromagnetic layer 25 is in contact with the bottomsurface of the upper electrode 30. The insulating layer 20 has thefunction of preventing the upper electrode 30 and the lower electrode 40from being electrically connected to each other through the first andsecond bias magnetic field generation units 21 or 22, and the functionof adjusting the positions of the first and second bias magnetic fieldgeneration units 21 and 22 in the Z direction. The magnetic sensor 1 mayinclude, instead of the insulating layer 20, another insulating layerinterposed between the upper electrode 30 and the first and second biasmagnetic field generation units 21 and 22. Alternatively, the magneticsensor 1 may include both of the insulating layer 20 and theaforementioned other insulating layer.

The ferromagnetic layer 24 has a magnetization in a direction parallelto the first direction (Y direction). The direction of the magnetizationof the ferromagnetic layer 24 is determined by exchange coupling betweenthe ferromagnetic layer 24 and each of the first and secondantiferromagnetic layers 23 and 25. In the first embodiment, theferromagnetic layer 24 of the first bias magnetic field generation unit21 and the ferromagnetic layer 24 of the second bias magnetic fieldgeneration unit 22 are magnetized in the same direction. The first andsecond bias magnetic field generation units 21 and 22 cooperate witheach other to generate, on the basis of the magnetizations of theferromagnetic layers 24, magnetic fields including a bias magnetic fieldHb to be applied to the MR element 10. The bias magnetic field Hb at thelocation where the MR element 10 is placed contains, as a principalcomponent, a component parallel to the first direction (Y direction) andoriented in the same direction as the magnetizations of theferromagnetic layers 24.

In each of the first and second bias magnetic field generation units 21and 22, the ferromagnetic layer 24 is formed of a ferromagnetic materialcontaining one or more elements selected from the group consisting ofCo, Fe and Ni. Examples of such a ferromagnetic material include CoFe,CoFeB, and CoNiFe. The ferromagnetic layer 24 may be formed of a stackof two or more layers in which every adjacent two layers are formed ofdifferent ferromagnetic materials. Examples of such a stack forming theferromagnetic layer 24 include a stack of a Co layer, a CoFe layer and aCo layer, and a stack of a Co₇₀Fe₃₀ layer, a Co₃₀Fe₇₀ layer and aCo₇₀Fe₃₀ layer. Note that Co₇₀Fe₃₀ represents an alloy containing 70atomic percent Co and 30 atomic percent Fe, and Co₃₀Fe₇₀ represents analloy containing 30 atomic percent Co and 70 atomic percent Fe. Thefirst and second antiferromagnetic layers 23 and 25 are each formed ofan antiferromagnetic material such as IrMn or PtMn. The ferromagneticlayer 24 preferably has a thickness of 8 nm or more. Assuming that theferromagnetic layer 24 is formed of CoFe and has a thickness of 8 nm,the first and second bias magnetic field generation units 21 and 22 cangenerate a bias magnetic field Hb having a strength of the order of 10Oe. Note that 1 Oe=79.6 A/m.

The second antiferromagnetic layer 25 is not an essential component ofeach of the first and second bias magnetic field generation units 21 and22, and can be dispensed with.

As shown in FIG. 4, each of the first and second bias magnetic fieldgeneration units 21 and 22 has a first end and a second end opposite toeach other in the X direction. The X direction is orthogonal to both ofthe first direction (Y direction) and the second direction (Zdirection), and corresponds to the third direction in the presentinvention. Hereinafter, the first end and the second end of the firstbias magnetic field generation unit 21 will be denoted by symbols E11and E12, respectively. The first end and the second end of the secondbias magnetic field generation unit 22 will be denoted by symbols E21and E22, respectively. When viewed from the MR element 10, the firstends E11 and E21 are located on the same side in the third direction (Xdirection).

In the example shown in FIG. 4, the first bias magnetic field generationunit 21 has a first end face 21 a facing toward the second bias magneticfield generation unit 22. The second bias magnetic field generation unit22 has a second end face 22 a opposed to the first end face 21 a.

In the example shown in FIG. 4, both of the first and second biasmagnetic field generation units 21 and 22 are in the shape of arectangular prism, and are rectangular when viewed in the seconddirection (Z direction). Alternatively, when viewed in the seconddirection (Z direction), the first and second bias magnetic fieldgeneration units 21 and 22 may each be in the shape of a polygon otherthan a rectangle, or may each be shaped such that at least a part of theouter edge thereof is curved. In the example shown in FIG. 4, all of thefirst ends E11 and E21 and the second ends E12 and E22 are in the formof a plane. Alternatively, at least one of the first and second endsE11, E21, E12 and E22 may be in the form of a line or a point.

An example of the configuration of the MR element 10 will now bedescribed with reference to FIG. 5. In the first embodiment, aspin-valve MR element is used as the MR element 10. The MR element 10includes at least a magnetization pinned layer 13 having a magnetizationpinned in a certain direction, a free layer 15 having a magnetizationthat varies depending on the target magnetic field, and a nonmagneticlayer 14 located between the magnetization pinned layer 13 and the freelayer 15.

In the example shown in FIG. 5, the MR element 10 further includes anunderlayer 11, an antiferromagnetic layer 12 and a protective layer 16.In this example, the underlayer 11, the antiferromagnetic layer 12, themagnetization pinned layer 13, the nonmagnetic layer 14, the free layer15 and the protective layer 16 are stacked along the second direction (Zdirection) in the listed order as viewed from the lower electrode 40.The underlayer 11 and the protective layer 16 are conductive. Theunderlayer 11 is provided to eliminate the effects of the crystal axisof the non-illustrated substrate and to improve the crystallinity andorientability of the layers to be formed over the underlayer 11. Theunderlayer 11 may be formed of Ta or Ru, for example. Theantiferromagnetic layer 12 is to pin the direction of the magnetizationof the magnetization pinned layer 13 by means of exchange coupling withthe magnetization pinned layer 13. The antiferromagnetic layer 12 isformed of an antiferromagnetic material such as IrMn or PtMn.

The magnetization of the magnetization pinned layer 13 is pinned in acertain direction by the exchange coupling between the antiferromagneticlayer 12 and the magnetization pinned layer 13. In the example shown inFIG. 5, the magnetization pinned layer 13 includes an outer layer 131, anonmagnetic intermediate layer 132 and an inner layer 133 stacked inthis order on the antiferromagnetic layer 12, and is thus formed as aso-called synthetic pinned layer. The outer layer 131 and the innerlayer 133 are each formed of a ferromagnetic material such as CoFe,CoFeB or CoNiFe. The outer layer 131 is exchange-coupled to theantiferromagnetic layer 12 and thus the magnetization direction thereofis pinned. The outer layer 131 and the inner layer 133 areantiferromagnetically coupled to each other, and their magnetizationsare thus pinned in mutually opposite directions. The nonmagneticintermediate layer 132 induces antiferromagnetic exchange couplingbetween the outer layer 131 and the inner layer 133 so as to pin themagnetizations of the outer layer 131 and the inner layer 133 inmutually opposite directions. The nonmagnetic intermediate layer 132 isformed of a nonmagnetic material such as Ru. When the magnetizationpinned layer 13 includes the outer layer 131, the nonmagneticintermediate layer 132 and the inner layer 133, the direction of themagnetization of the magnetization pinned layer 13 refers to that of theinner layer 133.

If the MR element 10 is a TMR element, the nonmagnetic layer 14 is atunnel barrier layer. The tunnel barrier layer may be formed byoxidizing a part or the whole of a magnesium layer. If the MR element 10is a GMR element, the nonmagnetic layer 14 is a nonmagnetic conductivelayer. The free layer 15 is formed of, for example, a soft magneticmaterial such as CoFe, CoFeB, NiFe, or CoNiFe. The protective layer 16is provided for protecting the layers located thereunder. The protectivelayer 16 may be formed of Ta, Ru, W, or Ti, for example.

The underlayer 11 is connected to the lower electrode 40, and theprotective layer 16 is connected to the upper electrode 30. The MRelement 10 is configured to be supplied with current by the lowerelectrode 40 and the upper electrode 30. The current flows in adirection intersecting the layers constituting the MR element 10, suchas the second direction (Z direction) which is perpendicular to thelayers constituting the MR element 10.

In the MR element 10, the magnetization of the free layer 15 variesdepending on the magnetic field applied to the free layer 15. Morespecifically, the direction and magnitude of the magnetization of thefree layer 15 vary depending on the direction and magnitude of themagnetic field applied to the free layer 15. The MR element 10 varies inresistance depending on the direction and magnitude of the magnetizationof the free layer 15. For example, if the free layer 15 has amagnetization of a constant magnitude, the MR element 10 has a minimumresistance when the magnetization of the free layer 15 is in the samedirection as that of the magnetization pinned layer 13, and has amaximum resistance when the magnetization of the free layer 15 is in theopposite direction to that of the magnetization pinned layer 13.

Reference is now made to FIG. 2 to describe the directions of themagnetizations of the magnetization pinned layers 13 of the MR elements10A to 10D. In FIG. 2, the arrows labeled 10AP, 10BP, 10CP and 10DPindicate the directions of the magnetizations of the magnetizationpinned layers 13 of the MR elements 10A, 10B, 10C and 10D, respectively.As shown in FIG. 2, the direction 10AP of the magnetization of themagnetization pinned layer 13 of the MR element 10A is parallel to the Xdirection. The direction 10AP is leftward in FIG. 2. The direction 10BPof the magnetization of the magnetization pinned layer 13 of the MRelement 10B is opposite to the direction 10AP. The direction 10BP isrightward in FIG. 2. In this case, the potential at the connection pointbetween the MR elements 10A and 10B varies depending on the strength ofa component of the target magnetic field in a direction parallel to thedirections 10AP and 10BP, i.e., in the X direction. The first outputport E1 outputs the first detection signal corresponding to thepotential at the connection point between the MR elements 10A and 10B.The first detection signal represents the strength of the component ofthe target magnetic field in the X direction.

As shown in FIG. 2, the direction 10CP of the magnetization of themagnetization pinned layer 13 of the MR element 10C is the same as thedirection 10AP, while the direction 10DP of the magnetization of themagnetization pinned layer 13 of the MR element 10D is the same as thedirection 10BP. In this case, the potential at the connection pointbetween the MR elements 10C and 10D varies depending on the strength ofthe component of the target magnetic field in the direction parallel tothe directions 10CP and 10DP (the same as the direction parallel to thedirections 10AP and 10BP), i.e., in the X direction. The second outputport E2 outputs the second detection signal corresponding to thepotential at the connection point between the MR elements 10C and 10D.The second detection signal represents the strength of the component ofthe target magnetic field in the X direction.

As for the MR element 10A and the MR element 10D, their respectivemagnetization pinned layers 13 have magnetizations in mutually oppositedirections. As for the MR element 10B and the MR element 10C, theirrespective magnetization pinned layers 13 have magnetizations inmutually opposite directions. Thus, the second detection signal has aphase difference of 180° with respect to the first detection signal.

In consideration of the production accuracy of the MR elements 10A to10D and other factors, the directions of the magnetizations of themagnetization pinned layers 13 of the MR elements 10A to 10D may beslightly different from the above-described directions.

Now, the bias magnetic field Hb generated by each of the four pairs offirst and second bias magnetic field generation units (21A, 22A), (21B,22B), (21C, 22C) and (21D, 22D) will be described with reference to FIG.2. In FIG. 2, the arrow labeled Hb indicates the direction of the biasmagnetic field Hb at the location of the MR element 10 situated nearestthe arrow. As shown in FIG. 2, at each of the locations where the MRelements 10A to 10D are placed, the bias magnetic field Hb contains acomponent in a direction parallel to the Y direction (the firstdirection). The direction is toward the upper right in FIG. 2. The biasmagnetic field Hb is used to make the free layer 15 have a singlemagnetic domain and to orient the magnetization of the free layer 15 ina certain direction, when the strength of the component of the targetmagnetic field in the X direction, i.e., in the direction parallel tothe magnetization direction of the pinned layer 13, is zero.

In the magnetic sensor system shown in FIG. 1, the magnetic sensor 1 isplaced to face the outer circumferential surface of the rotation scale50 in such a position that the Z direction is parallel or almostparallel to a straight line connecting the location of the magneticsensor 1 and the central axis C while the X direction is parallel oralmost parallel to an imaginary plane perpendicular to the central axisC. In this case, the direction of the principal component of the biasmagnetic field Hb at the location of the MR element 10, which is adirection parallel to the Y direction, is parallel or almost parallel tothe central axis C shown in FIG. 1.

Reference is now made to FIG. 2 and FIGS. 4 to 6 to describe thepositional relationship between the magnetic detection element (MRelement 10) and the first and second bias magnetic field generationunits 21 and 22. FIG. 6 is an explanatory diagram illustrating thepositional relationship between the MR element 10 and the first andsecond bias magnetic field generation units 21 and 22 shown in FIG. 4and FIG. 5. In FIG. 5 and FIG. 6, the symbol P represents an imaginaryplane perpendicular to the second direction (Z direction) andintersecting at least one magnetic detection element. The imaginaryplane P may intersect both or neither of the first and second biasmagnetic field generation units 21 and 22. In the latter case, the firstand second bias magnetic field generation units 21 and 22 may be locatedat the same position or different positions in the second direction (Zdirection). Alternatively, the imaginary plane P may intersect one ofthe first and second bias magnetic field generation units 21 and 22, notintersecting the other.

By way of example, FIGS. 2, 4 and 5 illustrate the case where theimaginary plane P intersects both of the first and second bias magneticfield generation units 21 and 22. In this case, as shown in FIG. 5, theimaginary plane P may intersect the ferromagnetic layer 24 of each ofthe first and second bias magnetic field generation units 21 and 22 andthe free layer 15 of the MR element 10.

Now, a first imaginary straight line L1 and a second imaginary straightline L2 are defined in the imaginary plane P as shown in FIG. 6. Thefirst imaginary straight line L1 is a straight line passing through thefirst ends E11 and E21 of the first and second bias magnetic fieldgeneration units 21 and 22 when viewed in the second direction (Zdirection). The second imaginary straight line L2 is a straight linepassing through the second ends E12 and E22 of the first and second biasmagnetic field generation units 21 and 22 when viewed in the seconddirection (Z direction). In FIG. 6, the first and second imaginarystraight lines L1 and L2 are shown by broken lines. The first and secondbias magnetic field generation units 21 and 22 are preferably shaped andpositioned to make the first and second imaginary straight lines L1 andL2 parallel to the first direction (Y direction).

If at least part of the first end E11 is located in the imaginary planeP, the first imaginary straight line L1 passes through the position ofthe first end E11 in the imaginary plane P. If the first end E11 islocated off the imaginary plane P, the first imaginary straight line L1passes through the position of a vertical projection of the first endE11 on the imaginary plane P.

If at least part of the first end E21 is located in the imaginary planeP, the first imaginary straight line L1 passes through the position ofthe first end E21 in the imaginary plane P. If the first end E21 islocated off the imaginary plane P, the first imaginary straight line L1passes through the position of a vertical projection of the first endE21 on the imaginary plane P.

If at least part of the second end E12 is located in the imaginary planeP, the second imaginary straight line L2 passes through the position ofthe second end E12 in the imaginary plane P. If the second end E12 islocated off the imaginary plane P, the first imaginary straight line L1passes through the position of a vertical projection of the second endE12 on the imaginary plane P.

If at least part of the second end E22 is located in the imaginary planeP, the second imaginary straight line L2 passes through the position ofthe second end E22 in the imaginary plane P. If the second end E22 islocated off the imaginary plane P, the second imaginary straight line L2passes through the position of a vertical projection of the second endE22 on the imaginary plane P.

In the example shown in FIG. 5 and FIG. 6, the imaginary plane Pintersects the first ends E11 and E21 and the second ends E12 and E22,all of which are in the form of a plane. In this case, the firstimaginary straight line L1 passes through the positions of the firstends E11 and E21 in the imaginary plane P, and the second imaginarystraight line L2 passes through the positions of the second ends E12 andE22 in the imaginary plane P.

The first and second bias magnetic field generation units 21 and 22 arepositioned to define an element placement region R in the imaginaryplane P. The element placement region R is located between the firstbias magnetic field generation unit 21 and the second bias magneticfield generation unit 22 when viewed in the second direction (Zdirection), and between the first imaginary straight line L1 and thesecond imaginary straight line L2.

The element placement region R is a region enclosed by a part of theperimeter of the first bias magnetic field generation unit 21 as viewedin the second direction (Z direction), a part of the perimeter of thesecond bias magnetic field generation unit 22 as viewed in the seconddirection (Z direction), the first imaginary straight line L1, and thesecond imaginary straight line L2.

In the example shown in FIG. 5 and FIG. 6, the first end face 21 a ofthe first bias magnetic field generation unit 21 and the second end face22 a of the second bias magnetic field generation unit 22 are parallelto the second direction (Z direction). The imaginary plane P intersectsthe first end face 21 a and the second end face 22 a. In this case, theelement placement region R is a region enclosed by the first end face 21a, the second end face 22 a, the first imaginary straight line L1, andthe second imaginary straight line L2.

As shown in FIG. 6, the element placement region R includes a first endregion R1, a second end region R2 and a middle region R3 each of whichhas an area. The first end region R1 is located closer to the firstimaginary straight line L1 than is the middle region R3. The second endregion R2 is located closer to the second imaginary straight line L2than is the middle region R3. The middle region R3 is located betweenthe first end region R1 and the second end region R2, borders on thefirst end region R1 along a first border line B1 parallel to the firstimaginary straight line L1, and borders on the second end region R2along a second border line B2 parallel to the second imaginary straightline L2. In FIG. 6, the first and second border lines B1 and B2 areshown by dotted lines.

The at least one magnetic detection element is placed such that theentirety of the at least one magnetic detection element lies within themiddle region R3 in the imaginary plane P. In the first embodiment, inparticular, one MR element 10 as the at least one magnetic detectionelement is placed such that the entirety of the MR element 10 lieswithin the middle region R3 in the imaginary plane P.

As shown in FIG. 6, the distance between the first imaginary straightline L1 and the first border line B1 will be denoted by the symbol D1,the distance between the second imaginary straight line L2 and thesecond border line B2 will be denoted by the symbol D2, and the distancebetween the first bias magnetic field generation unit 21 and the secondbias magnetic field generation unit 22 will be denoted by the symbol G1.The distances D1 and D2 are both preferably 30% of the distance G1. Thereasons therefor will be described in detail later.

FIG. 2 and FIGS. 4 to 6 illustrate an example in which only one MRelement 10 is situated within the middle region R3. Alternatively, aswill be described later in relation to a second embodiment, a pluralityof MR elements 10 may be situated within the the middle region R3.

The function and effects of the magnetic sensor 1 and the magneticsensor system according to the first embodiment will now be described.In the first embodiment, each of the first and second bias magneticfield generation units 21 and 22 includes the ferromagnetic layer 24 andthe first antiferromagnetic layer 23. The first antiferromagnetic layer23 is exchange-coupled to the ferromagnetic layer 24. The direction ofthe magnetization of the ferromagnetic layer 24 is thereby determined.The first and second bias magnetic field generation units 21 and 22cooperate with each other to generate the bias magnetic field Hb to beapplied to the MR element 10, on the basis of the magnetizations of theferromagnetic layers 24 of the first and second bias magnetic fieldgeneration units 21 and 22.

The effects of the magnetic sensor 1 according to the first embodimentwill now be described in comparison with a magnetic sensor of acomparative example. The magnetic sensor of the comparative example usesa pair of permanent magnets as the means for generating a bias magneticfield, in place of the first and second bias magnetic field generationunits 21 and 22. First, with reference to FIG. 7 and FIG. 8, comparisonswill be made between a magnetization curve of a permanent magnet andthat of each of the first and second bias magnetic field generationunits 21 and 22. FIG. 7 is a characteristic diagram illustrating themagnetization curve of a permanent magnet. FIG. 8 is a characteristicdiagram illustrating the magnetization curve of each of the first andsecond bias magnetic field generation units 21 and 22. Assume here thatthe magnetization curve of the first bias magnetic field generation unit21 and the magnetization curve of the second bias magnetic fieldgeneration unit 22 coincide with each other. In each of FIG. 7 and FIG.8, the horizontal axis represents magnetic field, and the vertical axisrepresents magnetization. For both of the magnetic field and themagnetization, positive values represent magnitude in a predetermineddirection, while negative values represent magnitude in the oppositedirection from the predetermined direction. Arrows in the magnetizationcurves indicate the direction of a change in the magnetic field. Therange of the magnetic field indicated with the symbol HS represents therange of the target magnetic field.

The magnetic sensor of the comparative example is used under thecondition that the strength of the target magnetic field does not exceedthe coercivity of the permanent magnets. However, an external magneticfield having a strength exceeding the coercivity of the permanentmagnets can happen to be temporarily applied to the permanent magnets,because the magnetic sensor can be used in various environments. Whensuch an external magnetic field is temporarily applied to the permanentmagnets, the direction of the magnetization of the permanent magnets maybe changed from an original direction and then remain different from theoriginal direction even after the external magnetic field disappears.For example, as shown in FIG. 7, if an external magnetic field of apositive value beyond the range HS of the target magnetic field istemporarily applied to the permanent magnets, the direction of themagnetization of the permanent magnets is pinned in a positive directionafter the external magnetic field disappears. On the other hand, if anexternal magnetic field of a negative value falling outside the range HSof the target magnetic field is temporarily applied to the permanentmagnets, the direction of the magnetization of the permanent magnets ispinned in a negative direction after the external magnetic fielddisappears. Thus, in the magnetic sensor of the comparative example, atemporary application of an external magnetic field of a strengthexceeding the coercivity of the permanent magnets to the permanentmagnets may change the direction of the bias magnetic field from adesired direction.

In contrast, in each of the first and second bias magnetic fieldgeneration units 21 and 22 of the first embodiment, as understood fromFIG. 8, even if an external magnetic field having a high strengthsufficient to reverse the direction of the magnetization of theferromagnetic layer 24 is temporarily applied, the direction of themagnetization of the ferromagnetic layer 24 returns to an originaldirection upon disappearance of such an external magnetic field. Thefirst embodiment thus allows application of a stable bias magnetic fieldHb to the MR element 10. This advantageous effect is enhanced byproviding each of the bias magnetic field generation units 21 and 22with the second antiferromagnetic layer 25.

In the first embodiment, as shown in FIG. 6, at least one MR element 10is placed such that the entirety of the at least one one MR element 10lies within the middle region R3 in the imaginary plane P. According tothe first embodiment, this makes it possible to apply a bias magneticfield Hb of high uniformity to the MR element 10 and also reduce avariation in the bias magnetic field Hb in response to a variation inthe relative positional relationship between the MR element 10 and thefirst and second bias magnetic field generation units 21 and 22. Suchadvantageous effects will now be described in detail.

First, a reference component will be defined as follows. The referencecomponent is a component of the bias magnetic field Hb in the samedirection as the magnetization of the ferromagnetic layer 24 in theimaginary plane P. The reference component is a principal component ofthe bias magnetic field Hb to be applied to the MR element 10.

Next, simulation results will be described. The simulation investigatedthe distribution of strength of the reference component of the biasmagnetic field Hb in the imaginary plane P for a first to a third modelof the magnetic sensor 1. In the first model, the first and second biasmagnetic field generation units 21 and 22 shown in FIG. 6 are 8.8 μm inlength in the X direction, and are spaced a distance G1 of 2 μm apartfrom each other. In the second model, the first and second bias magneticfield generation units 21 and 22 are 8.8 μm in length in the Xdirection, and are spaced a distance G1 of 3 μm apart from each other.In the third model, the first and second bias magnetic field generationunits 21 and 22 are 18.8 μm in length in the X direction, and are spaceda distance G1 of 2 μm apart from each other. In each of the first tothird models, the imaginary plane P intersects the first and second biasmagnetic field generation units 21 and 22.

FIGS. 9 to 11 are characteristic diagrams illustrating the distributionsof strengths of the reference component of the bias magnetic field Hb inthe imaginary plane P for the first to third models of the magneticsensor 1, respectively. In each of FIGS. 9 to 11, the horizontal axisrepresents position on a straight line parallel to the X direction andpassing through a center point of the middle region R3 in the imaginaryplane P shown in FIG. 6. The center point of the middle region R3 is thepoint located equidistant from the first end face 21 a and the secondend face 22 a and also equidistant from the first border line B1 and thesecond border line B2. On the horizontal axis of each of FIGS. 9 to 11,the position of the center point of the middle region R3 is taken as 0μm, and negative values represent positions that are on the side of thefirst imaginary straight line L1 with respect to the center point of themiddle region R3, while positive values represent positions that are onthe side of the second imaginary straight line L2 with respect to thecenter point of the middle region R3. The vertical axis in each of FIGS.9 to 11 represents the strength of the reference component of the biasmagnetic field Hb in the imaginary plane P. In FIGS. 9 to 11, thestrength of the reference component of the bias magnetic field Hb in theimaginary plane P is normalized so that its maximum value is 100%.

In each of FIGS. 9 to 11, the two broken lines L1 and L2 represent thepositions of the first and second imaginary straight lines L1 and L2shown in FIG. 6, respectively. The dotted line B1 represents theposition of the first border line B1 determined with the distance D1between the first imaginary straight line L1 and the first border lineB1 in FIG. 6 set at 30% of the distance G1. The dotted line B2represents the position of the second border line B2 determined with thedistance D2 between the second imaginary straight line L2 and the secondborder line B2 in FIG. 6 set at 30% of the distance G1.

In each of FIGS. 9 to 11, the distribution of strength of the referencecomponent between the lines B1 and B2 represents the distribution ofstrength thereof in the middle region R3 determined with both of thedistances D1 and D2 set at 30% of the distance G1. The distribution ofstrength of the reference component between the lines L1 and B1represents the distribution of strength thereof in the first end regionR1. The distribution of strength of the reference component between thelines L2 and B2 represents the distribution of strength thereof in thesecond end region R2.

As shown in FIGS. 9 to 11, in the first end region R1 and the second endregion R2 the strength of the reference component sharply decreases withincreasing distance from the center point of the middle region R3. Thus,the gradient of change in the strength of the reference component versusthe change in the position along the third direction (X direction) isclearly larger in the first and second end regions R1 and R2 than in themiddle region R3. Accordingly, by placing the MR element 10 such thatthe entirety thereof lies within the middle region R3, it is possible toapply a bias magnetic field Hb of higher uniformity to the MR element 10and to reduce a variation in the bias magnetic field Hb in response to avariation in the relative positional relationship between the MR element10 and the first and second bias magnetic field generation units 21 and22, as compared with the case where the MR element 10 is placed suchthat at least a part thereof lies within the first end region R1 or thesecond end region R2 when viewed in the second direction (Z direction).

FIGS. 9 to 11 indicate that when the distances D1 and D2 are both set at30% of the distance G1, the strength of the reference component in themiddle region R3 falls within the range of 80% to 100% of the maximumstrength of the reference component in the imaginary plane P. From theviewpoint of reducing a variation in the strength of the referencecomponent in the middle region R3 in which the MR element 10 is placed,it is preferred that both of the distances D1 and D2 be 30% of thedistance G1.

In order to allow the entirety of the MR element 10 to lie within themiddle region R3 in the imaginary plane P when both of the distances D1and D2 are 30% of the distance G1, the distance between the firstimaginary straight line L1 and the second imaginary straight line L2shown in FIG. 6 needs to be at least 60% of the distance G1 plus thewidth of the MR element 10 in the X direction. By minimizing thedistance between the first imaginary straight line L1 and the secondimaginary straight line L2 while satisfying the above requirement, itbecomes possible to apply a bias magnetic field Hb of high uniformity tothe MR element 10 while minimizing the entire magnetic sensor 1 in size.

If the imaginary plane P intersects neither of the first and second biasmagnetic field generation units 21 and 22, the strength of the referencecomponent in the middle region R3 decreases with increasing distancefrom the imaginary plane P to each of the first and second bias magneticfield generation units 21 and 22. Now, the strength of the referencecomponent at the center point of the middle region R3 assuming that theimaginary plane P intersects the first and second bias magnetic fieldgeneration units 21 and 22 will be referred to as the referencestrength. In order to reduce a decrease in the strength of the referencecomponent in the middle region R3 when the imaginary plane P intersectsneither of the first and second bias magnetic field generation units 21and 22, the first and second bias magnetic field generation units 21 and22 preferably have such a positional relationship with the imaginaryplane P that the strength of the reference component at the center pointof the middle region R3 is 80% or more of the reference strength.

Some read head units in magnetic heads for use in magnetic disk drivesare structured to include an MR element and a pair of bias magneticfield generation units arranged so that the bias magnetic fieldgeneration units are opposed to each other with the MR elementtherebetween. In such read head units, one end of the MR element and oneend of each of the pair of bias magnetic field generation units arealigned in the medium facing surface, which is a surface of the magnetichead to face the recording medium. In contrast, according to the firstembodiment, the arrangement of the MR element 10 and the first andsecond bias magnetic field generation units 21 and 22 is such that oneend of the MR element 10 is not aligned with one end of each of thefirst and second bias magnetic field generation units 21 and 22. Thus,the read head units in magnetic heads do not satisfy the requirementpertaining to the arrangement of the MR element 10 and the first andsecond bias magnetic field generation units 21 and 22 of the firstembodiment. For the read head units in magnetic heads, placing the MRelement in such a position as to satisfy the requirement pertaining tothe arrangement of the MR element 10 and the first and second biasmagnetic field generation units 21 and 22 of the first embodiment is notconceivable because such a placement of the MR element would bring oneend of the MR element away from the medium facing surface and therebymake the MR element lower in sensitivity.

Second Embodiment

A second embodiment of the invention will now be described withreference to FIG. 12. FIG. 12 is an explanatory diagram illustrating thepositional relationship of MR elements 10 with first and second biasmagnetic field generation units 21 and 22 in a magnetic sensor 1according to the second embodiment. The magnetic sensor 1 according tothe second embodiment includes eight MR elements 10, four first biasmagnetic field generation units 21, four second bias magnetic fieldgeneration units 22, a substrate (not illustrated), two upper electrodes30, and two lower electrodes 40. In the second embodiment, two MRelements 10 connected in parallel by the upper and lower electrodes 30and 40 are placed at each of the locations of the MR elements 10A, 10B,10C and 10D described in the first embodiment section.

In the second embodiment, every two MR elements 10 are placed such thatthe entirety of each of the two MR elements 10 lies within the middleregion R3 of the element placement region R described in the firstembodiment section. The magnetization pinned layers 13 of the two MRelements 10 are magnetized in the same direction. The second embodimentmakes it possible to apply bias magnetic fields Hb of high uniformity tothe two MR elements 10 and to reduce a difference in strength betweenthe bias magnetic fields Hb to be applied to the two MR elements 10.

The remainder of configuration, function and effects of the secondembodiment are similar to those of the first embodiment.

Third Embodiment

A third embodiment of the invention will now be described with referenceto FIG. 13. FIG. 13 is a perspective view illustrating the generalconfiguration of a magnetic sensor system of the third embodiment. Themagnetic sensor system of the third embodiment differs from that of thefirst embodiment in the following ways. The magnetic sensor system ofthe third embodiment has a linear scale 150 in place of the rotationscale 50. The linear scale 150 has a plurality of pairs of N and S polesarranged alternately in a linear configuration. The linear scale 150 hasa side surface parallel to the direction in which the N and S poles arearranged. The magnetic sensor 1 is placed to face the side surface ofthe linear scale 150.

One of the linear scale 150 and the magnetic sensor 1 moves linearly ina predetermined direction D in response to the movement of a movingobject (not illustrated). This causes a change in the relative positionof the linear scale 150 with respect to the magnetic sensor 1 in thedirection D. The direction D is the direction in which the N and S polesof the linear scale 150 are arranged. The magnetic sensor systemdetects, as the physical quantity associated with the relativepositional relationship between the linear scale 150 and the magneticsensor 1, the position and/or speed of the aforementioned moving bodymoving with one of the linear scale 150 and the magnetic sensor 1, forexample.

In the third embodiment, the target magnetic field is generated by thelinear scale 150, and the direction of the target magnetic field varieswith changes in the relative position of the linear scale 150 withrespect to the magnetic sensor 1.

The magnetic sensor 1 may be configured in the same manner as the firstor second embodiment. The remainder of configuration, function andeffects of the third embodiment are similar to those of the first orsecond embodiment.

The present invention is not limited to the foregoing embodiments, andvarious modifications may be made thereto. For example, as far as therequirements of the appended claims are met, the shapes and locations ofthe first and second bias magnetic field generation units 21 and 22, andthe number, shape and location of the MR element 10 need not necessarilybe as in the respective examples illustrated in the foregoingembodiments, and can be freely chosen.

Further, the MR element 10 may be formed by stacking the underlayer 11,the free layer 15, the nonmagnetic layer 14, the magnetization pinnedlayer 13, the antiferromagnetic layer 12, and the protective layer 16 inthis order from the lower electrode 40 side.

It is apparent that the present invention can be carried out in variousforms and modifications in the light of the foregoing descriptions.Accordingly, within the scope of the following claims and equivalentsthereof, the present invention can be carried out in forms other thanthe foregoing most preferable embodiments.

What is claimed is:
 1. A magnetic sensor comprising: at least onemagnetic detection element for detecting a magnetic field to bedetected; and a first bias magnetic field generation unit and a secondbias magnetic field generation unit configured to cooperate with eachother to generate a bias magnetic field to be applied to the at leastone magnetic detection element, wherein the first bias magnetic fieldgeneration unit and the second bias magnetic field generation unit arespaced a predetermined distance apart from each other along a firstdirection, the at least one magnetic detection element is locatedbetween the first bias magnetic field generation unit and the secondbias magnetic field generation unit in the first direction, each of thefirst and second bias magnetic field generation units includes aferromagnetic layer and a first antiferromagnetic layer stacked along asecond direction orthogonal to the first direction, the ferromagneticlayer has a first surface and a second surface located at opposite endsin the second direction, the first antiferromagnetic layer is in contactwith the first surface of the ferromagnetic layer and exchange-coupledto the ferromagnetic layer, each of the first and second bias magneticfield generation units has a first end and a second end opposite to eachother in a third direction orthogonal to both of the first direction andthe second direction, the first and second bias magnetic fieldgeneration units are positioned to define an element placement region,the element placement region being located between the first biasmagnetic field generation unit and the second bias magnetic fieldgeneration unit when viewed in the second direction, and between a firststraight line connecting the first end of each of the first and secondbias magnetic field generation units when viewed in the second directionand a second straight line connecting the second end of each of thefirst and second bias magnetic field generation units when viewed in thesecond direction, the element placement region includes a first endregion, a second end region and a middle region each of which has anarea, the first end region is located closer to the first straight linethan is the middle region, the second end region is located closer tothe second straight line than is the middle region, the middle region islocated between the first end region and the second end region, borderson the first end region along a first border line parallel to the firststraight line, and borders on the second end region along a secondborder line parallel to the second straight line, and the at least onemagnetic detection element is placed such that an entirety of the atleast one magnetic detection element lies within the middle region. 2.The magnetic sensor according to claim 1, wherein the ferromagneticlayer has a magnetization in a direction parallel to the firstdirection, and the bias magnetic field at a location where the at leastone magnetic detection element is placed contains a component in thesame direction as the magnetization of the ferromagnetic layer.
 3. Themagnetic sensor according to claim 1, wherein a distance between thefirst straight line and the first border line, and a distance betweenthe second straight line and the second border line are both 30% of thedistance between the first bias magnetic field generation unit and thesecond bias magnetic field generation unit.
 4. The magnetic sensoraccording to claim 1, wherein the at least one magnetic detectionelement is at least one magnetoresistance element.
 5. The magneticsensor according to claim 4, wherein the at least one magnetoresistanceelement includes a magnetization pinned layer having a magnetizationpinned in a certain direction, a free layer having a magnetization thatvaries depending on the magnetic field to be detected, and a nonmagneticlayer located between the magnetization pinned layer and the free layer,and the magnetization pinned layer, the nonmagnetic layer and the freelayer are stacked along the second direction.
 6. The magnetic sensoraccording to claim 5, wherein the free layer of the at least onemagnetoresistance element is located between the ferromagnetic layer ofeach of the first and second bias magnetic field generation units in thefirst direction.
 7. The magnetic sensor according to claim 1, whereineach of the first and second bias magnetic field generation unitsfurther includes a second antiferromagnetic layer that is in contactwith the second surface of the ferromagnetic layer and exchange-coupledto the ferromagnetic layer.